{include file='public/header'/}
<form class="layui-form" action="" attr-url = "{:url('config/merchant')}" style="margin-top: 20px;">
    <div class="layui-form-item">
        <label class="layui-form-label">商户账号</label>
        <div class="layui-input-inline">
            <input type="text" name="account" readonly="readonly" value="{$merchant->account}" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">商户名称</label>
        <div class="layui-input-inline">
            <input type="text" name="name" readonly="readonly" value="{$merchant->name}" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">联系电话</label>
        <div class="layui-input-inline">
            <input type="text" name="phone" value="{$merchant->phone}" lay-verify="phone" placeholder="请输入" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">商户邮箱</label>
        <div class="layui-input-inline">
            <input type="text" name="email" value="{$merchant->email}" lay-verify="email" placeholder="请输入" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">商户logo</label>
        <div class="layui-input-inline">
            <div class="layui-upload-drag" id="drafting_pic">
                <img src="{$merchant->logo}" alt="" id="img">
                <i class="layui-icon" id="img_icon"></i>
                <p>点击上传，或将文件拖拽到此处</p>
                <input type="hidden" id="mer_logo" name="logo" value="">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">新密码</label>
        <div class="layui-input-inline">
            <input type="password" name="pwd" id="pwd" lay-verify="require" placeholder="请输入" autocomplete="off" class="layui-input">
        </div>
        <div class="layui-form-mid layui-word-aux">不填写则不修改</div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">确认密码</label>
        <div class="layui-input-inline">
            <input type="password" name="password_enter" lay-verify="regPwd" placeholder="请输入" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item layui-form-text" style="width: 50%;">
        <label class="layui-form-label">商家介绍</label>
        <div class="layui-input-block">
            <textarea name="txt_info" placeholder="请输入内容" class="layui-textarea">{$merchant->txt_info}</textarea>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" type="submit" lay-submit lay-filter="formDemo">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>
<script>
    layui.use(['form', 'jquery'], function() {
        var $ = layui.jquery;
        var form = layui.form;
        form.verify({
            regPwd: function(value) {
                //获取密码
                var pwd = $("#pwd").val();
                if(value != pwd) {
                    return '两次输入的密码不一致';
                }
            }
        });
    });
</script>
<script src="/static/admin/js/common.js"></script>
<script src="/static/merchant/js/image.js"></script>
</body>
</html>